<template>
    <div>
<h1>会员详情信息</h1>
<table class="table">
    <tbody>
        <tr>
            <td>id</td>
            <td>
                {{ data.id }}
                <input type="text"  :value="data.id" disabled >
            </td>
        </tr>
        <tr>
            <td>name</td>
            <td>
               {{data.name}}
            </td>
        </tr>
        <tr>
            <td>password</td>
            <td>
                ******
            </td>
        </tr>
        <tr>
            <td>age</td>
            <td>
                {{ data.age }}
            </td>
        </tr>
        <tr>
            <td>sex</td>
            <td>
                {{ data.sex==1?"男":"女" }}
            </td>
        </tr>
        <tr>
            <td>birthday</td>
            <td>
                {{  moment( data.birthday).format("YYYY年MM月DD日") }}
            </td>
        </tr>
    </tbody>
</table>




    </div>


    <a href="/">返回</a>
</template>

<script setup lang="ts">

import axios from 'axios';
import { ref,onMounted } from 'vue';
import { useRoute } from 'vue-router';
import moment from 'moment';

const route = useRoute()

const data=ref(
    {
  "id": 0,
  "name": "string",
  "password": "string",
  "age": 0,
  "sex": 0,
  "birthday": "2025-04-22T06:36:16.827Z",
  "houbbyCount": 0,
  "houbbyString": "string",
  "start": true,
  "isDelete": true,
  "img": "string",
  "memberLevelId": 0,
  "createData": "2025-04-22T06:36:16.827Z"
}
)



onMounted(()=>{
    getdata()
})

const getdata=()=>{
    //取会员id
    var mid =  route.query.vid
    //再使用会员id调用API
    axios.get("https://localhost:7225/api/Member/GetMember",{params:{id:mid}}).then(res=>{
        data.value  = res.data;
        console.log(data.value)
    })
}


</script>

<style scoped>

</style>